Skip to content

fix: add missing perPage param on sponsor forms tables, adjust names#970

Open
tomrndom wants to merge 2 commits into
masterfrom
fix/sponsor-form-pagination
Open

fix: add missing perPage param on sponsor forms tables, adjust names#970
tomrndom wants to merge 2 commits into
masterfrom
fix/sponsor-form-pagination

Conversation

@tomrndom

@tomrndom tomrndom commented Jun 10, 2026

Copy link
Copy Markdown

ref: https://app.clickup.com/t/86bact0p7

Summary by CodeRabbit

  • Improvements
    • Enhanced pagination for sponsor forms: the page parameter is used consistently, items-per-page is tracked, and changing items-per-page resets to the first page.
  • Tests
    • Updated tests to reflect the pagination parameter rename and to reset request mock state before specific refetch scenarios.

…for consistency

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 87c1705c-b0f6-4a0f-87fa-56c476c6919c

📥 Commits

Reviewing files that changed from the base of the PR and between 76c2233 and b51cfe7.

📒 Files selected for processing (1)
  • src/actions/__tests__/sponsor-forms-actions.test.js

📝 Walkthrough

Walkthrough

Pagination parameters in sponsor forms actions are now consistently named page (instead of currentPage) and include page and perPage metadata in request flows. The reducer captures both pagination values in state. Per-page UI changes reset pagination to the default page.

Changes

Sponsor Forms Pagination Parameter Alignment

Layer / File(s) Summary
Action layer pagination parameter alignment & tests
src/actions/sponsor-forms-actions.js, src/actions/__tests__/sponsor-forms-actions.test.js
getSponsorForms param renamed from currentPage to page; getSponsorForms, getSponsorManagedForms, and getSponsorCustomizedForms pass page and perPage (plus term/summitTZ where applicable) in getRequest metadata. Tests updated to expect page and to clear getRequest mock before re-mocking.
Reducer pagination state capture
src/reducers/sponsors/sponsor-page-forms-list-reducer.js
Request payload destructuring includes perPage; REQUEST_SPONSOR_MANAGED_FORMS and REQUEST_SPONSOR_CUSTOMIZED_FORMS store currentPage (from page) and perPage in their respective state slices.
UI handler pagination reset on per-page change
src/pages/sponsors/show-pages-list-page/index.js
handlePerPageChange now calls getShowPages with DEFAULT_CURRENT_PAGE instead of currentPage, resetting pagination when per-page changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • smarcet

Poem

🐰 A page turned clean, parameters aligned,
Requests now whisper page where currentPage dined,
Per-page hops reset to the starting line,
Redux stores both numbers, tidy and fine,
Hooray — the lists now paginate in rhyme! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main changes: adding the missing perPage parameter to sponsor forms tables and adjusting parameter names (currentPage → page) for consistency across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sponsor-form-pagination

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@tomrndom tomrndom requested a review from smarcet June 11, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant